const { join, resolve } = require('path');

const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
    mode: "development",
    output: {
        assetModuleFilename: "images/[name][ext]",
        filename: "scrpts/[name].bundle.js"
    },
    devServer: {
        historyApiFallback: true,
        contentBase: join(__dirname, '../dist'),
        port: 8081,
        // host: '0.0.0.0',
        // inline: true, // iframe
        // 配置 
        // friendly-error-webpack-plugin
        // node-notify
        // webpack-build-notifier
        // quiet: true
        watchContentBase: true
    },
    devtool: "source-map",
    plugins: [
        new HtmlWebpackPlugin({
            title: "hooome",
            filename: "index.html",
            template: resolve(__dirname, "../src/index-dev.html"),
        }),
    ]  
}